<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title>MeteoCal - Invite for #{iBean.find(iBean.newInvite.id).event.title}</title>
        <link href="../css/application.css" rel="stylesheet"></link>
        <link href="../css/datetimeevent.css" rel="stylesheet"></link>
        <link rel="icon" type="image/ico" href="../images/logoico.ico"/>
        <f:metadata>
            <f:viewParam name="id" value="#{iBean.newInvite.id}" />
        </f:metadata>
    </h:head>
    <h:body style="min-height: 800px;"><div id="body">

            <div id="head">
                <a href="personalpage.xhtml"><img src="../images/logo.png" /></a>
                
                <h:form><p:commandLink action="#{loginBean.logout()}">
    <p:graphicImage value="../images/logout.png" style="width: 70px; top:140px; left:88%;"/>
</p:commandLink></h:form>
            </div>

            <div id="title">
                <p1>MeteoCal</p1><br />
                <p2>Your website to plan your events.</p2>
            </div>
            
            <div id="bar">
                <a href="personalpage.xhtml" id="ppage" >#{uBean.actualLoggedUser.username} 's MeteoCal</a>
                <a href="calendar.xhtml" id="calendar">Calendar</a>
                <a href="search.xhtml" id="search">Search MeteoCal's friends</a>
            </div>

            <div id="e_creation">
                <center>
                    <h:form id="event_form">
                        You received an invite for 
                        #{iBean.find(iBean.newInvite.id).event.title}.
                        <br />
                        Will you participate to the event?
                        <br /><br />
                        <h:selectOneRadio value="#{iBean.accept}" 
                                                     id="accept" >
                                    <f:selectItem itemValue="#{1}" itemLabel="Yes"  />
                                    <f:selectItem itemValue="#{0}" itemLabel="No" />
                                </h:selectOneRadio>
                        <br /><br />
                        
                        <p:commandButton value="Confirm" 
                                         action="#{iBean.confirmInv(uBean.actualLoggedUser, iBean.find(iBean.newInvite.id).event, iBean.accept)}"  
                                           style="border:0; box-shadow:0px 2px 5px #000000;" />
                    </h:form></center>
            </div>

        </div>      
    </h:body>
</html>

